package main

import (
	"context"
	"log"
	"time"

	configx "config"
	"kitexz/protocol/thriftx/kitex_gen/api"
	"kitexz/protocol/thriftx/kitex_gen/api/loginservice"

	"github.com/cloudwego/kitex/client"
)

func main() {
	client := loginservice.MustNewClient(configx.ServerName, client.WithHostPorts(configx.LocalServerHost))
	for {
		ctx, cancel := context.WithTimeout(context.Background(), time.Second*3)
		resp, err := client.Login(ctx, &api.Request{Message: "Hello"})
		cancel()
		if err != nil {
			log.Fatal(err)
		}
		log.Println(resp)
		time.Sleep(time.Second)
	}

}
